<?php
namespace Admin\Models\school;
use Admin\Models\BaseModel;
class XhschoolPublicClass extends BaseModel
{

    /**
     *
     * @var integer
     * @Primary
     * @Identity
     * @Column(type="integer", length=11, nullable=false)
     */
    public $iPCId;

    public $mDesc;
    public $iRunChargeId;
    public $iAtClassChargeId;
    public $iWebChargeId;
    public $iTechChargeId;
    public $iMarkChargeId;
    public $mEvaluate;
    public $iEvalId;
    public $tEvalTime;


    /**
     *
     * @var integer
     * @Column(type="integer", length=11, nullable=true)
     */
    public $iUserId;


    public $tStartTime;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $sPlace;

    public $iStuNum;
    public $iAttendNum;

    public $iPCType;


    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $sAttendClass;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $mAttendences;

    public $sFiles;
    public $sImages;
    public $mContent;

    /**
     *
     * @var integer
     * @Column(type="integer", length=4, nullable=true)
     */
    public $bDelete;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $tCreateDate;

    /**
     *
     * @var integer
     * @Column(type="integer", length=20, nullable=true)
     */
    public $iCreateUserId;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $tLastModifyDate;

    /**
     *
     * @var integer
     * @Column(type="integer", length=20, nullable=true)
     */
    public $iLastModifyUserId;

    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        parent::initialize();
        $this->keepSnapshots(true);
        $this->setSchema("xh_webmanage");
    }

    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'XHSchool_PublicClass';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return XhschoolPublicClass[]|XhschoolPublicClass
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return XhschoolPublicClass
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }


    public function beforeUpdate(){
        if($this->hasChanged('tEvalTime')){

        }else{
            parent::beforeUpdate();
        }
    }
}
